﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MinistryStandardPlatformWeb.Models
{
    public class MileageStatistics
    {
        public string Sim { get; set; }
        public string VehicleId { get; set; }
        public string ParentUnitName { get; set; }
        public string StatisticsTime { get; set; }
        public string Mileage { get; set; }
    }


    public class MileageStatisticsMileageEquality : IEqualityComparer<MileageStatistics>
    {
        public bool Equals(MileageStatistics x, MileageStatistics y)
        {          
            if (string.IsNullOrEmpty(x.Mileage) && string.IsNullOrEmpty(y.Mileage))
            {
                return true;
            }

            return x.Mileage == y.Mileage;
        }

        public int GetHashCode(MileageStatistics obj)
        {
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return obj.ToString().GetHashCode();
            }
        }
    }

}